package com.inspur.sc.springboot.controller;

import com.inspur.sc.springboot.entity.SysRole;
import com.inspur.sc.springboot.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("admin")
public class AdminController {

    @Autowired
    private SysRoleService roleService;

    @RequestMapping("user")
    public String user(Model model){
        List<SysRole> roles= roleService.findAll();
        model.addAttribute("roles",roles);
        return "page/admin/user";
    }

    @RequestMapping("role")
    public String role(Model model){
        return "page/admin/role";
    }

    @RequestMapping("permissionGroup")
    public String permissionGroup(Model model){
        return "page/admin/permissionGroup";
    }

    @RequestMapping("permission")
    public String permission(Model model){
        return "page/admin/permission";
    }

    @RequestMapping("menu")
    public String menu(Model model){
        return "page/admin/menu";
    }
}
